package com.blb.order_service.feign;

import com.blb.order_service.entity.Goods;
import com.blb.order_service.fallback.GoodsServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 调用商品服务的Feign客户端
 * FeignClient里面指定了调用的服务名
 */
@FeignClient(value = "goods-service",path = "/goods",fallback = GoodsServiceFallback.class)
public interface GoodsFeignClient {

    /**
     * 对应被调用服务的方法
     */
    @GetMapping("/{id}")
    Goods findById(@PathVariable("id") Long id);
}
